﻿using System;
using System.Globalization;

namespace PairingMatrix.ViewModel
{
    public class DateDisplayViewModel : ViewModelBase
    {
        public DateDisplayViewModel(DateTime date)
        {
            _date = date;
        }

        public string DateDisplayText
        {
            get { 
                return _date.Day +
                (
                    (_date.Day % 10 == 1 && _date.Day != 11) ? "st" :
                    (_date.Day % 10 == 2 && _date.Day != 12) ? "nd" :
                    (_date.Day % 10 == 3 && _date.Day != 13) ? "rd" : "th"
                ) + " "
                    + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(_date.Month).Substring(0,3); 
                 }
        }

        private DateTime _date;
        public DateTime Date
        {
            get { return _date; }
        }


    }
}